package com.rois.librois.RoIS;


/**
* RoIS/_ServiceApplicationBaseStub.java .
* IDL-to-Java コンパイラ (ポータブル), バージョン "3.1" で生成
* 生成元: RoIS_IDL.idl
* 2011年9月8日 0時05分18秒 JST
*/


/******************************************
 * For Service Application
******************************************/
public class _ServiceApplicationBaseStub extends org.omg.CORBA.portable.ObjectImpl implements com.rois.librois.RoIS.ServiceApplicationBase
{


  /* For System Interface */
  public void receive_error (String error_id, com.rois.librois.RoIS.ErrorType error_type)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("receive_error", true);
                $out.write_string (error_id);
                com.rois.librois.RoIS.ErrorTypeHelper.write ($out, error_type);
                $in = _invoke ($out);
                return;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                receive_error (error_id, error_type        );
            } finally {
                _releaseReply ($in);
            }
  } // receive_error


  /* For Command Interface */
  public void completed (String command_id, com.rois.librois.RoIS.Completed_Status status)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("completed", true);
                $out.write_string (command_id);
                com.rois.librois.RoIS.Completed_StatusHelper.write ($out, status);
                $in = _invoke ($out);
                return;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                completed (command_id, status        );
            } finally {
                _releaseReply ($in);
            }
  } // completed


  /* For Event Interface */
  public void receive_event (String event_id, String event_type, String subscribe_id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("receive_event", true);
                $out.write_string (event_id);
                $out.write_string (event_type);
                $out.write_string (subscribe_id);
                $in = _invoke ($out);
                return;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                receive_event (event_id, event_type, subscribe_id        );
            } finally {
                _releaseReply ($in);
            }
  } // receive_event

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:RoIS/ServiceApplicationBase:1.0"};

  public String[] _ids ()
  {
    return (String[])__ids.clone ();
  }

  private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  {
     String str = s.readUTF ();
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
   try {
     org.omg.CORBA.Object obj = orb.string_to_object (str);
     org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
     _set_delegate (delegate);
   } finally {
     orb.destroy() ;
   }
  }

  private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  {
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
   try {
     String str = orb.object_to_string (this);
     s.writeUTF (str);
   } finally {
     orb.destroy() ;
   }
  }
} // class _ServiceApplicationBaseStub
